﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DraftList.aspx.cs" Inherits="Workflow.DraftList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="js/jquery.js" type="text/javascript"></script>
    <script src="js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript">
        function showAdv() {
            $("#divQuery").toggle();
        }

        function changeCss1(ele) {
            $(ele).css("cur");
        }

        $(document).ready(function () {
            if ($("#txtShowQuery").val() == "1") {
                $("#divQuery").show();
            }
        });

        function changeStatus(ele) {
            $("input[type='checkbox']").attr("checked", ele.checked);
        }
    </script>
</head>
<body>
    <style type="text/css">
        input[type='text']
        {
            height: 13px;
            width: 100px;
        }
        
        .lbl
        {
            display: inline-block;
            width: 90px;
        }
        
        .small
        {
            height: 22px;
            padding-top: 0px;
            margin-top: 0px;
        }
    </style>
    <script type="text/javascript">
        function assign() {
            var taskid = "";
            $("#tab tr").each(function () {
                if ($(this).find("td:eq(0)").children().attr("checked")) {
                    taskid += $(this).find("td:eq(0)").children().val() + ",";
                }
            });
            if (taskid != "") {
                taskid = taskid.substring(0, taskid.lastIndexOf(","));
            }
            var PageName = "Assign.aspx";
            if (taskid != "") {
                PageName += "?TaskID=" + encodeURI(taskid);
            }
            window.showModalDialog(PageName, "javascript", "dialogHeight=300px;dialogWidth=500px;scroll=no;");
            location.reload();
        }
    </script>
    <form id="form1" runat="server">
    <div class="category_nav_box hidden">
        <dl class="first">
            <dt>
                <%=Workflow.Resources.lang.TaskList_ProcessCategory %>：</dt>
            <dd>
                <%--<asp:Repeater ID="rptProcessCategory" runat="server">
                    <ItemTemplate>
                        <a href='<%#GetProcessCategoryUrl(Eval("CATEGORYNAME").ToString()) %>' class='<%#GetProcessCategoryCurCss(Eval("CATEGORYNAME").ToString()) %>'
                            target="_self">
                            <%#Eval("CategoryName") %></a>
                    </ItemTemplate>
                </asp:Repeater>--%>
            </dd>
        </dl>
        <%--<dl>
            <dt>
                <%=Workflow.Resources.lang.TaskList_StartTime %>：</dt>
            <dd>
                <a href='<%=GetDateTypeUrl("0") %>' class='<%=GetDateTypeCurCss("0") %>'>
                    <%=Workflow.Resources.lang.TaskList_All %></a> <a href='<%=GetDateTypeUrl("1") %>'
                        class='<%=GetDateTypeCurCss("1") %>'>
                        <%=Workflow.Resources.lang.TaskList_Week %></a> <a href='<%=GetDateTypeUrl("2") %>'
                            class='<%=GetDateTypeCurCss("2") %>'>
                            <%=Workflow.Resources.lang.TaskList_Month %></a> <a href='<%=GetDateTypeUrl("3") %>'
                                class='<%=GetDateTypeCurCss("3") %>'>
                                <%=Workflow.Resources.lang.TaskList_3Month %></a> <a class="right" href="javascript:showAdv();">
                                    <%=Workflow.Resources.lang.TaskList_AdvSearch %></a>
            </dd>
        </dl>--%>
        <div id="divQuery" class="hide">
            <dl style="padding-top: 6px; padding-bottom: 9px">
                <dt>
                    <%=Workflow.Resources.lang.TaskList_Search %>：</dt>
                <dd>
                    <asp:Label ID="lblProcessName" runat="server" Text="流程名称" CssClass="lbl"></asp:Label>
                    <asp:TextBox ID="txtProcessName" CssClass="input-query" runat="server"></asp:TextBox>
                    <asp:Label ID="lblStartTime" runat="server" Text="开始时间" CssClass="lbl"></asp:Label>
                    <asp:TextBox ID="txtStartDate" CssClass="input-query" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy/MM/dd'})"
                        runat="server"></asp:TextBox>
                    <asp:Label ID="Label6" runat="server" Text="-" CssClass="lbl"></asp:Label>
                    <asp:TextBox ID="txtEndDate" CssClass="input-query" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy/MM/dd'})"
                        runat="server"></asp:TextBox>
                </dd>
            </dl>
            <dl style="padding-top: 6px; padding-bottom: 9px">
                <dd>
                    <asp:Label ID="lblIncident" runat="server" Text="实例号" CssClass="lbl"></asp:Label>
                    <asp:TextBox ID="txtIncident" CssClass="input-query" runat="server"></asp:TextBox>
                    <div class="hidden">
                        <asp:Label ID="lblApplicant" runat="server" Text="申请人" CssClass="lbl"></asp:Label>
                        <asp:TextBox ID="txtApplicant" CssClass="input-query" runat="server"></asp:TextBox></div>
                    <asp:Label ID="lblSummary" runat="server" Text="摘要" CssClass="lbl"></asp:Label>
                    <asp:TextBox ID="txtSummary" CssClass="input-query" runat="server"></asp:TextBox>
                    <%-- <asp:Button ID="btnSearch" runat="server" CssClass="btn small" Text="查询" OnClick="btnSearch_Click" />--%>
                </dd>
            </dl>
        </div>
        <%--  <dl class="sort_order">
            <dt>
                <%=Workflow.Resources.lang.TaskList_Sort %>：</dt>
            <dd>
                <a href='<%=GetSortUrl("a.STARTTIME DESC") %>' class='<%=GetSortCurCss("0") %>'>
                    <%=Workflow.Resources.lang.TaskList_Default %></a> <a href='<%=GetSortUrl("a.STARTTIME DESC") %>'
                        class='<%=GetSortCurCss("a.STARTTIME DESC") %>'>
                        <%=Workflow.Resources.lang.TaskList_StartTime %></a> <a href='<%=GetSortUrl("a.PROCESSNAME") %>'
                            class='<%=GetSortCurCss("a.PROCESSNAME") %>'>
                            <%=Workflow.Resources.lang.TaskList_ProcessName %></a>
                <%--  <a href='<%=GetSortUrl("b.INITIATOR") %>' class='<%=GetSortCurCss("b.INITIATOR") %>'><%=Workflow.Resources.lang.TaskList_Applicant %></a>--%>
        </dd> </dl>--%>
    </div>
    <div class="pt10">
    </div>
    <div>
        <table class="table table-bordered table-hover table-condensed" id="tab">
            <thead>
                <tr>
                    <th class="hide">
                        <asp:CheckBox ID="cbAll" runat="server" onclick="changeStatus(this);" />
                    </th>
                    <th>
                        <%=Workflow.Resources.lang.TaskList_ProcessName%>
                    </th>
                    <th>
                        <%=Workflow.Resources.lang.TaskList_Summary%>
                    </th>
                    <th>
                        <%=Workflow.Resources.lang.TaskList_StartTime%>
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
            </thead>
            <tbody>
                <asp:Repeater ID="rptTask" runat="server" OnItemCommand="rptTask_ItemCommand">
                    <ItemTemplate>
                        <tr>
                            <td style="width: 20px;" class="hide">
                                <asp:CheckBox ID="cbSelect" runat="server" />
                            </td>
                            <td>
                                <a href="OpenForm.aspx?ProcessName=<%#GetUrl(Eval("ProcessName"))%>&Incident=<%#Eval("Incident")%>&Type=Draft&TASKID=<%#Eval("TASKID")%>"
                                    target="_blank">
                                    <%#Eval("PROCESSNAME")%></a>
                            </td>
                            <td>
                                <%#Eval("SUMMARY")%>
                            </td>
                            <td>
                                <%#Convert.ToDateTime(Eval("CREATEDATE")).ToString("yyyy/MM/dd HH:mm:ss")%>
                            </td>
                            <td>
                                <asp:Button ID="btnDelete" runat="server" Text="删除" CssClass="btn" CommandName="del"
                                    CommandArgument='<%#Eval("FormID") %>' ClientIDMode="Static" OnClientClick="return confirm('确认删除？')" />
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </tbody>
        </table>
    </div>
    <div id="pagelist">
        <span class="right">
            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" CustomInfoHTML="Count %RecordCount%"
                Width="100%" CssClass="aspNetPager" OnPageChanged="AspNetPager1_PageChanged"
                AlwaysShow="true">
            </webdiyer:AspNetPager></span>
    </div>
    <div style="display: none">
        <asp:TextBox ID="txtType" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtPreSort" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtSort" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtStartTime" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtDateType" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtShowQuery" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtProcessCategory" runat="server"></asp:TextBox>
    </div>
    </form>
</body>
</html>
